package com.sc.nft.enums;

import cn.hutool.core.util.ArrayUtil;
import com.baomidou.mybatisplus.annotation.EnumValue;
import lombok.AllArgsConstructor;
import lombok.Getter;

@AllArgsConstructor
@Getter
public enum UserBalanceTypeEnum {

    BALANCE(1, "提现余额"),
    PAY_BALANCE(2, "支付余额"),//红包
    WISH_BALANCE(3, "心愿礼金"),//实物红包

    ;
    @EnumValue
    private int code;
    private String description;

    public static UserBalanceTypeEnum of(int code) {
        return ArrayUtil.firstMatch(item -> item.getCode() == code, UserBalanceTypeEnum.values());
    }

}
